<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:composition template="/WEB-INF/template/basicTemplate.xhtml">
	<h:head>

	</h:head>
	<f:event listener="#{biletBean.verifyTL()}" type="preRenderView"></f:event>
	<h:body>

		<h:form>
			<h:dataTable value="#{biletBean.bilete}" var="b">

				<h:column>

					<f:facet name="header">ID</f:facet>

					<h:inputText value="#{b.id}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header"><h:outputText value="#{msg.lastname}" /> </f:facet>

					<h:inputText value="#{b.lastname}" size="20" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.firstname}" />
					</f:facet>

					<h:inputText value="#{b.firstname}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.motive}" />
					</f:facet>

					<h:inputText value="#{b.motiv}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.start}" />
					</f:facet>

					<h:inputText value="#{b.start_time}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.end}" />
					</f:facet>

					<h:inputText value="#{b.end_time}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.status}" />
					</f:facet>

					<h:inputText value="#{b.status}" size="10" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.approve}" />
					</f:facet>

					<h:commandButton image="/resources/images/check.png" action="#{biletBean.aprova(b)}" />

				</h:column>

				<h:column>

					<f:facet name="header">
						<h:outputText value="#{msg.refuse}" />
					</f:facet>

					<h:commandButton image="/resources/images/cross.png" action="#{biletBean.refuza(b)}" />

				</h:column>

			</h:dataTable>

			<h:commandButton value="#{msg.back}" styleClass="button"
				action="#{loginBean.inapoiTL()}" />
			<br></br>

			<h:commandButton value="#{msg.logout}" styleClass="button"
				action="#{loginBean.logOut()}" />
			<br></br>

			<h:messages styleClass="errorMessage"></h:messages>
		</h:form>
	</h:body>
</ui:composition>
</html>